/*
 * Copyright (c) Huawei Device Co., Ltd. 2024. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef EF_AC_RULES_H
#define EF_AC_RULES_H

#include <map>
#include <vector>

#include "ef_parser.h"

namespace OHOS {
namespace SE {
class EfAcRules : public EfParser {
public:
    EfAcRules();
    ~EfAcRules();

    bool ParseAcRulesFileByPath(const std::vector<uint8_t> &acRulePath);

private:
    bool ParseAcRuleFileData(const std::vector<uint8_t> &fileData);

    std::map<std::string, std::vector<uint8_t>> acConditionDataCache_ {};
    const std::vector<uint8_t> DEFAULT_APP {};

    static const uint8_t TAG_RESTRICT_AID = 0xA0;
    static const uint8_t TAG_EMPTY_AID = 0x81;
    static const uint8_t TAG_DEFAULT_APP = 0x82;
};
}  // namespace SE
}  // namespace OHOS
#endif // EF_AC_RULES_H